let array1 = [1,2,3,4,5];
let array2 = ['a','b','c'];
let array3 = "xyz";

function * zip(...arry){
    let group_num = Number.MAX_SAFE_INTEGER;
    let res = [];
    let i = 0;

    // 找出最短长度
    for (group of arry) {
        if (group_num > group.length) {
            group_num = (group.length);
        }
    }

    for (let j=0;j<group_num;j++){
        res.push([]);
    }

    for (group of arry){
        for (let j=0;j<group_num;j++){
            res[j][i] = group[j]
        }
        i ++;
    }

    for (let line of res){
        yield line;
    }

}

res = zip(array1, array2, array3);
console.log(res.next());
console.log(res.next());
console.log(res.next());
console.log(res.next());
